home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 273_01.zip / MAKEWIND.CC < prev    next >
Text File  |  1993-04-04  |  1KB  |  40 lines

  1. make_window(int trow, int tcol, int brow, int bcol, int wattr, int battr, int shadow, char *title, char *footer)
  2. /* Make a window at the specified location.
  3.    trow=upper left row of window   range 0-24
  4.    tcol=upper left col of windoe   range 0-79
  5.    brow=lower right row of window
  6.    bcol=lower right col of window
  7.    wattr=attribute of window
  8.    battr=attribute of border of window
  9.    shadow=0=no shadow =1=make a shadow
  10.    title=title for window
  11.    footer=bottom footer for window
  12.    Needs the following golbal data defined:
  13.    int color, mono, cga, ega, scrseg, bios;
  14. */
  15.  
  16. {
  17.     int num_cols = bcol - tcol + 1;
  18.     int title_len, adjust;
  19.     if(shadow) make_shadow(trow,tcol,brow,bcol);
  20.     box(trow,tcol,brow,bcol,wattr,battr);
  21.     title_len=strlen(title) + 2;
  22.     if(title_len < 3) return;
  23.     if(title_len >= num_cols) return;
  24.     adjust=((num_cols - title_len) / 2) + tcol;
  25.     writef(trow,adjust,battr,"[");
  26.     writef(trow,adjust+1,battr,title);
  27.     adjust=adjust + title_len - 1;
  28.     writef(trow,adjust,battr,"]");
  29.  
  30.     title_len=strlen(footer) + 2;
  31.     if(title_len < 3) return;
  32.     if(title_len >= num_cols) return;
  33.     adjust=((num_cols - title_len) / 2) + tcol;
  34.     writef(brow,adjust,battr,"[");
  35.     writef(brow,adjust+1,battr,footer);
  36.     adjust=adjust + title_len - 1;
  37.     writef(brow,adjust,battr,"]");
  38. }
  39. 
  40.